package com.ruoyi.system.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.system.api.domain.store.StockIn;
import com.ruoyi.system.api.factory.RemoteFileFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author 罗梦杰
 * date 2024/11/1 14:58
 * @version 1.0
 */
@FeignClient(contextId = "remoteStockInService", value = ServiceNameConstants.STORE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
public interface RemoteStockInService {
    @PostMapping("/stockIn/getStockInList")
    List<StockIn> getStockList(@RequestBody StockIn stockIn);

    @GetMapping("/stockIn/getInfo/returnR/{id}")
    R<StockIn> getStockIn(@PathVariable("id") Integer id);

    @PostMapping("/stockIn/getStockInByCode/{code}")
    R<StockIn> getStockInByCode(@PathVariable("code") String code,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/stockIn/innerUpd")
    R<Boolean> innerUpd(@RequestBody StockIn stockIn, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/stockIn/confirmInNo")
    AjaxResult confirmIn(@RequestBody StockIn stockIn,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
